#include <jni.h>
#include <android/native_window.h>
#include <android/native_window_jni.h>
#include "android/log.h"

extern "C"
JNIEXPORT void JNICALL
Java_com_lyn_showYUV_ShowYUV_showData(JNIEnv *env, jobject thiz, jbyteArray data, jint width,
                                      jint height, jobject surface) {
    // TODO: implement showData()
    jbyte *data_ = env->GetByteArrayElements(data, NULL);
    ANativeWindow *window = ANativeWindow_fromSurface(env, surface);
    ANativeWindow_setBuffersGeometry(window,width,height,WINDOW_FORMAT_RGBA_8888);
}